from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1225, 745)
        MainWindow.setMinimumSize(QtCore.QSize(1225, 745))
        MainWindow.setMaximumSize(QtCore.QSize(1225, 745))
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("icon/12.png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
        MainWindow.setWindowIcon(icon)
        # MainWindow.setStyleSheet("background-color: rgb(101, 121, 114);")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.select_save_path = QtWidgets.QLabel(self.centralwidget)
        self.select_save_path.setGeometry(QtCore.QRect(939, 625, 16, 16))
        self.select_save_path.setText("")
        self.select_save_path.setPixmap(QtGui.QPixmap("VLC-IconSmall.png"))
        self.select_save_path.setObjectName("select_save_path")
        self.label_title = QtWidgets.QLabel(self.centralwidget)
        self.label_title.setGeometry(QtCore.QRect(380, 10, 421, 31))
        font = QtGui.QFont()
        font.setFamily("西安工业大学")
        font.setPointSize(16)
        self.label_title.setFont(font)
        self.label_title.setTextFormat(QtCore.Qt.AutoText)
        self.label_title.setAlignment(QtCore.Qt.AlignCenter)
        self.label_title.setObjectName("label_title")
        self.gridLayoutWidget = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 130, 341, 62))
        self.gridLayoutWidget.setObjectName("gridLayoutWidget")
        self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        self.label_ziyuan = QtWidgets.QLabel(self.gridLayoutWidget)
        font = QtGui.QFont()
        font.setFamily("阿里巴巴普惠体")
        font.setPointSize(12)
        self.label_ziyuan.setFont(font)
        self.label_ziyuan.setTextFormat(QtCore.Qt.AutoText)
        self.label_ziyuan.setObjectName("label_ziyuan")
        self.gridLayout.addWidget(self.label_ziyuan, 0, 0, 1, 1)
        self.Button_openCamera = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.Button_openCamera.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.Button_openCamera.setStyleSheet("border: none")
        self.Button_openCamera.setText("")
        icon1 = QtGui.QIcon()
        #icon1.addPixmap(QtGui.QPixmap("icon/摄像头_camera-one.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Button_openCamera.setIcon(icon1)
        self.Button_openCamera.setIconSize(QtCore.QSize(32, 32))
        self.Button_openCamera.setObjectName("Button_openCamera")
        self.gridLayout.addWidget(self.Button_openCamera, 0, 3, 1, 1)
        self.Button_select_folder = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.Button_select_folder.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.Button_select_folder.setStyleSheet("border: none")
        self.Button_select_folder.setText("")
        icon2 = QtGui.QIcon()
        # icon2.addPixmap(QtGui.QPixmap("icon/文件夹-开_folder-open.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        icon2.addPixmap(QtGui.QPixmap("icon/文件夹-开_folder-open.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Button_select_folder.setIcon(icon2)
        self.Button_select_folder.setIconSize(QtCore.QSize(32, 32))
        self.Button_select_folder.setObjectName("Button_select_folder")
        self.gridLayout.addWidget(self.Button_select_folder, 0, 4, 1, 1)
        self.Button_checkImg = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.Button_checkImg.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.Button_checkImg.setStyleSheet("border: none;")
        self.Button_checkImg.setText("")
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap("icon/照片_pic.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Button_checkImg.setIcon(icon3)
        self.Button_checkImg.setIconSize(QtCore.QSize(32, 32))
        self.Button_checkImg.setObjectName("Button_checkImg")
        self.gridLayout.addWidget(self.Button_checkImg, 0, 1, 1, 1)
        self.Button_checkVideo = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.Button_checkVideo.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.Button_checkVideo.setStyleSheet("border: none")
        self.Button_checkVideo.setText("")
        icon4 = QtGui.QIcon()
        icon4.addPixmap(QtGui.QPixmap("icon/·视频_video.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.Button_checkVideo.setIcon(icon4)
        self.Button_checkVideo.setIconSize(QtCore.QSize(32, 32))
        self.Button_checkVideo.setObjectName("Button_checkVideo")
        self.gridLayout.addWidget(self.Button_checkVideo, 0, 2, 1, 1)
        self.gridLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_2.setGeometry(QtCore.QRect(10, 70, 341, 41))
        self.gridLayoutWidget_2.setObjectName("gridLayoutWidget_2")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.gridLayoutWidget_2)
        self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.label_weights = QtWidgets.QLabel(self.gridLayoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("西安工业大学")
        font.setPointSize(12)
        self.label_weights.setFont(font)
        self.label_weights.setObjectName("label_weights")
        self.gridLayout_2.addWidget(self.label_weights, 1, 0, 1, 1)
        self.line_weights = QtWidgets.QLineEdit(self.gridLayoutWidget_2)
        font = QtGui.QFont()
        font.setFamily("西安工业大学")
        font.setPointSize(11)
        self.line_weights.setFont(font)
        self.line_weights.setInputMask("")
        self.line_weights.setEchoMode(QtWidgets.QLineEdit.Normal)
        self.line_weights.setPlaceholderText("")
        self.line_weights.setObjectName("line_weights")
        self.gridLayout_2.addWidget(self.line_weights, 1, 1, 1, 1)
        self.Button_select_w_p = QtWidgets.QPushButton(self.gridLayoutWidget_2)
        self.Button_select_w_p.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.Button_select_w_p.setStyleSheet("border: none")
        self.Button_select_w_p.setText("")
        self.Button_select_w_p.setIcon(icon2)
        self.Button_select_w_p.setIconSize(QtCore.QSize(32, 32))
        self.Button_select_w_p.setObjectName("Button_select_w_p")
        self.gridLayout_2.addWidget(self.Button_select_w_p, 1, 2, 1, 1)
        self.gridLayoutWidget_3 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_3.setGeometry(QtCore.QRect(10, 200, 341, 41))
        self.gridLayoutWidget_3.setObjectName("gridLayoutWidget_3")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.gridLayoutWidget_3)
        self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.doubleSpinBox_conf = QtWidgets.QDoubleSpinBox(self.gridLayoutWidget_3)
        self.doubleSpinBox_conf.setMaximum(1.0)
        self.doubleSpinBox_conf.setSingleStep(0.01)
        self.doubleSpinBox_conf.setProperty("value", 0.25)
        self.doubleSpinBox_conf.setObjectName("doubleSpinBox_conf")
        self.gridLayout_3.addWidget(self.doubleSpinBox_conf, 0, 1, 1, 1)
        self.label_conf = QtWidgets.QLabel(self.gridLayoutWidget_3)
        font = QtGui.QFont()
        font.setFamily("阿里巴巴普惠体")
        font.setPointSize(12)
        self.label_conf.setFont(font)
        self.label_conf.setObjectName("label_conf")
        self.gridLayout_3.addWidget(self.label_conf, 0, 0, 1, 1)
        self.label_iou = QtWidgets.QLabel(self.gridLayoutWidget_3)
        font = QtGui.QFont()
        font.setFamily("阿里巴巴普惠体")
        font.setPointSize(12)
        self.label_iou.setFont(font)
        self.label_iou.setLayoutDirection(QtCore.Qt.RightToLeft)
        self.label_iou.setTextFormat(QtCore.Qt.AutoText)
        self.label_iou.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_iou.setObjectName("label_iou")
        self.gridLayout_3.addWidget(self.label_iou, 0, 2, 1, 1)
        self.doubleSpinBox_iou = QtWidgets.QDoubleSpinBox(self.gridLayoutWidget_3)
        self.doubleSpinBox_iou.setMaximum(1.0)
        self.doubleSpinBox_iou.setSingleStep(0.01)
        self.doubleSpinBox_iou.setProperty("value", 0.45)
        self.doubleSpinBox_iou.setObjectName("doubleSpinBox_iou")
        self.gridLayout_3.addWidget(self.doubleSpinBox_iou, 0, 3, 1, 1)
        self.gridLayoutWidget_4 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_4.setGeometry(QtCore.QRect(10, 260, 251, 31))
        self.gridLayoutWidget_4.setObjectName("gridLayoutWidget_4")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.gridLayoutWidget_4)
        self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.label_isSava = QtWidgets.QLabel(self.gridLayoutWidget_4)
        font = QtGui.QFont()
        font.setFamily("阿里巴巴普惠体")
        font.setPointSize(12)
        self.label_isSava.setFont(font)
        self.label_isSava.setObjectName("label_isSava")
        self.gridLayout_4.addWidget(self.label_isSava, 0, 0, 1, 1)
        self.checkBox_isSave = QtWidgets.QCheckBox(self.gridLayoutWidget_4)
        font = QtGui.QFont()
        font.setPointSize(16)
        self.checkBox_isSave.setFont(font)
        self.checkBox_isSave.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.checkBox_isSave.setText("")
        self.checkBox_isSave.setIconSize(QtCore.QSize(40, 40))
        self.checkBox_isSave.setObjectName("checkBox_isSave")
        self.gridLayout_4.addWidget(self.checkBox_isSave, 0, 1, 1, 1)
        self.gridLayoutWidget_5 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_5.setGeometry(QtCore.QRect(10, 370, 341, 341))
        self.gridLayoutWidget_5.setObjectName("gridLayoutWidget_5")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.gridLayoutWidget_5)
        self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.result = QtWidgets.QTextBrowser(self.gridLayoutWidget_5)
        font = QtGui.QFont()
        font.setFamily("阿里巴巴普惠体")
        font.setPointSize(12)
        self.result.setFont(font)
        self.result.setStyleSheet("border:1px solid white")
        self.result.setObjectName("result")
        self.gridLayout_5.addWidget(self.result, 0, 0, 1, 1)
        self.gridLayoutWidget_6 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_6.setGeometry(QtCore.QRect(1090, 10, 46, 42))
        self.gridLayoutWidget_6.setObjectName("gridLayoutWidget_6")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.gridLayoutWidget_6)
        self.gridLayout_6.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.pushButton_logo = QtWidgets.QPushButton(self.gridLayoutWidget_6)
        self.pushButton_logo.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.pushButton_logo.setStyleSheet("border: none")
        self.pushButton_logo.setText("")
        self.pushButton_logo.setIcon(icon)
        self.pushButton_logo.setIconSize(QtCore.QSize(32, 32))
        self.pushButton_logo.setObjectName("pushButton_logo")
        self.gridLayout_6.addWidget(self.pushButton_logo, 1, 0, 1, 1)
        self.gridLayoutWidget_7 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_7.setGeometry(QtCore.QRect(370, 670, 841, 42))
        self.gridLayoutWidget_7.setObjectName("gridLayoutWidget_7")
        self.gridLayout_7 = QtWidgets.QGridLayout(self.gridLayoutWidget_7)
        self.gridLayout_7.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_7.setObjectName("gridLayout_7")
        self.progressBar = QtWidgets.QProgressBar(self.gridLayoutWidget_7)
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(110, 181, 219))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        self.progressBar.setPalette(palette)
        self.progressBar.setProperty("value", 0)
        self.progressBar.setObjectName("progressBar")
        self.gridLayout_7.addWidget(self.progressBar, 0, 1, 1, 1)
        self.pushButton_bofang = QtWidgets.QPushButton(self.gridLayoutWidget_7)
        self.pushButton_bofang.setMinimumSize(QtCore.QSize(32, 32))
        self.pushButton_bofang.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.pushButton_bofang.setStyleSheet("border: none")
        self.pushButton_bofang.setText("")
        icon5 = QtGui.QIcon()
        icon5.addPixmap(QtGui.QPixmap("icon/暂停_pause.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton_bofang.setIcon(icon5)
        self.pushButton_bofang.setIconSize(QtCore.QSize(32, 32))
        self.pushButton_bofang.setObjectName("pushButton_bofang")
        self.gridLayout_7.addWidget(self.pushButton_bofang, 0, 0, 1, 1)
        self.gridLayoutWidget_8 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_8.setGeometry(QtCore.QRect(1140, 10, 41, 41))
        self.gridLayoutWidget_8.setObjectName("gridLayoutWidget_8")
        self.gridLayout_8 = QtWidgets.QGridLayout(self.gridLayoutWidget_8)
        self.gridLayout_8.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_8.setObjectName("gridLayout_8")
        self.pushButton_info = QtWidgets.QPushButton(self.gridLayoutWidget_8)
        self.pushButton_info.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.pushButton_info.setStyleSheet("border: none")
        self.pushButton_info.setText("")
        icon6 = QtGui.QIcon()
        icon6.addPixmap(QtGui.QPixmap("icon/帮助_help.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton_info.setIcon(icon6)
        self.pushButton_info.setIconSize(QtCore.QSize(32, 32))
        self.pushButton_info.setObjectName("pushButton_info")
        self.gridLayout_8.addWidget(self.pushButton_info, 0, 0, 1, 1)
        self.gridLayoutWidget_9 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_9.setGeometry(QtCore.QRect(370, 60, 821, 597))
        self.gridLayoutWidget_9.setObjectName("gridLayoutWidget_9")
        self.gridLayout_9 = QtWidgets.QGridLayout(self.gridLayoutWidget_9)
        self.gridLayout_9.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_9.setObjectName("gridLayout_9")
        self.label_result = QtWidgets.QLabel(self.gridLayoutWidget_9)
        self.label_result.setStyleSheet("border: 1px solid white;")
        self.label_result.setText("")
        self.label_result.setPixmap(QtGui.QPixmap("data/images/XX.png"))
        self.label_result.setObjectName("label_result")
        self.gridLayout_9.addWidget(self.label_result, 0, 0, 1, 1)
        self.gridLayoutWidget_10 = QtWidgets.QWidget(self.centralwidget)
        self.gridLayoutWidget_10.setGeometry(QtCore.QRect(10, 310, 181, 42))
        self.gridLayoutWidget_10.setObjectName("gridLayoutWidget_10")
        self.gridLayout_10 = QtWidgets.QGridLayout(self.gridLayoutWidget_10)
        self.gridLayout_10.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_10.setObjectName("gridLayout_10")
        self.label_speed = QtWidgets.QLabel(self.gridLayoutWidget_10)
        font = QtGui.QFont()
        font.setFamily("阿里巴巴普惠体")
        font.setPointSize(16)
        self.label_speed.setFont(font)
        self.label_speed.setObjectName("label_speed")
        self.gridLayout_10.addWidget(self.label_speed, 0, 1, 1, 1)
        self.button_speed_title = QtWidgets.QPushButton(self.gridLayoutWidget_10)
        self.button_speed_title.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.button_speed_title.setStyleSheet("border:none;text-align: left;")
        self.button_speed_title.setText("")
        icon7 = QtGui.QIcon()
        icon7.addPixmap(QtGui.QPixmap("icon/速度_speed-one.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.button_speed_title.setIcon(icon7)
        self.button_speed_title.setIconSize(QtCore.QSize(32, 32))
        self.button_speed_title.setFlat(False)
        self.button_speed_title.setObjectName("button_speed_title")
        self.gridLayout_10.addWidget(self.button_speed_title, 0, 0, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    # 本软件由微智启软件工作室基于yolov5 7.0+pyqt5开发，已申请版权，禁止商用盗卖，否则承担法律侵权风险。
    # 商用授权/举报邮箱：3447362049@qq.com

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "西安工业大学底片识别系统"))
        self.label_title.setText(_translate("MainWindow", "西安工业大学底片识别系统"))
        self.label_ziyuan.setText(_translate("MainWindow", "检测资源："))
        self.Button_openCamera.setToolTip(_translate("MainWindow", "开启/关闭摄像头"))
        self.Button_select_folder.setToolTip(_translate("MainWindow", "选取图片文件夹检测"))
        self.Button_checkImg.setToolTip(_translate("MainWindow", "检测单张图片"))
        self.Button_checkVideo.setToolTip(_translate("MainWindow", "检测视频文件"))
        self.label_weights.setText(_translate("MainWindow", "权重："))
        self.line_weights.setText(_translate("MainWindow", "yolov5s.pt"))
        self.label_conf.setText(_translate("MainWindow", "置信度："))
        self.label_iou.setText(_translate("MainWindow", "IOU："))
        self.label_isSava.setToolTip(_translate("MainWindow", "默认保存在当前目录runs文件夹"))
        self.label_isSava.setText(_translate("MainWindow", "是否保存结果："))
        self.checkBox_isSave.setToolTip(_translate("MainWindow", "默认保存在当前目录runs文件夹"))
        self.result.setToolTip(_translate("MainWindow", "检测的结果展示窗口"))
        self.result.setPlaceholderText(_translate("MainWindow", "检测结果展示"))
        #self.pushButton_info.setToolTip(_translate("MainWindow", "关于软件"))
        self.label_speed.setText(_translate("MainWindow", "00.00ms"))

